import java.util.Scanner;

public class HomeWork12_05{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        Filter f = new Filter();
        
        int[] arr = new int[10];
        System.out.print("please enter 10 integers:");
        for(int i = 0; i < arr.length; i++){
            arr[i] = scan.nextInt();
        }
        // for(int item : arr){
        //     System.out.println(item);
        // }
        
        arr = f.filter(arr);
        for(int item : arr){
            System.out.println(item);
        }
    }
}

class Filter{
    public int[] filter(int[] arr){
        int tail = arr.length - 1;
        for(int i = 0; i < arr.length; i++){
            for(int j = i + 1; j < tail + 1; ){
                if(arr[i] == arr[j]){
                    int temp = arr[j];
                    arr[j] = arr[tail];
                    arr[tail] = temp;
                    
                    --tail;
                }else{
                    ++j;
                }
            }
        }
        
        int[] newArr = new int[tail + 1];
        for(int i = 0; i < tail + 1; i++){
            newArr[i] = arr[i];
        }
        return newArr;
    }
}